//
//  MFAPMNetMonitorModel.h
//  MFAPMManager
//
//  Created by zhang liyu on 2019/5/25.
//

#import <Foundation/Foundation.h>
#import "MFAPMBaseModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface MFAPMNetMonitorModel : MFAPMBaseModel

#pragma mark - Request

/**
 请求对象
 */
@property (nonatomic, strong) NSURLRequest *request;

/**
 请求方式：1(HTTP)、2(DNS)、3(Socket)
 */
@property (nonatomic, assign) NSInteger requestMode;

/**
 请求来源：1(自身)、2(第三方)
 */
@property (nonatomic, assign) NSInteger requestSource;

/**
 请求类型：POST、GET、PUT、DELETE
 */
@property (nonatomic, copy) NSString *requestMethod;

/**
 请求的url
 */
@property (nonatomic, copy) NSString *url;

/**
 请求域名
 */
@property (nonatomic, copy) NSString *domain;

/**
 请求IP
 */
@property (nonatomic, copy) NSString *ip;

/**
 请求参数
 */
@property (nonatomic, copy) NSString *requestParameter;

/**
 请求信息
 */
@property (nonatomic, copy) NSString *requestBody;

/**
 headers
 */
@property (nonatomic, copy) NSString *requestHeaders;

#pragma mark - Response

/**
 返回结果对象
 */
@property (nonatomic, strong) NSURLResponse *response;

/**
 http状态码
 */
@property (nonatomic, copy) NSString *statusCode;

/**
 返回结果中自带的逻辑状态码，用于标明逻辑是否正确
 请求返回错误编码
 */
@property (nonatomic, copy) NSString *responseCode;

/**
 请求返回错误信息
 */
@property (nonatomic, copy) NSString *responseMessage;

/**
 返回信息
 */
@property (nonatomic, copy) NSString *responseBody;

/**
 MIME类型
 */
@property (nonatomic, copy) NSString *responseMIMEType;

#pragma mark - Data Deal Methods

- (void)updateRequestData:(NSURLRequest *)request;

- (void)updateResponseData:(NSURLResponse *)response;

- (void)updateErrorData:(NSError *)error;

- (void)updateReceiveData:(NSData *)data;

- (void)finishRequest;

@end

NS_ASSUME_NONNULL_END
